#include <i_sigslot.hpp>

slot::slot()
{

}
slot::~slot()
{
	disconnect_all();
}

void slot::signal_connect(signal_base* slot)
{
	m_connected.insert(slot);
}

void slot::signal_disconnect(signal_base* slot)
{
	m_connected.erase(slot);
}

void slot::disconnect_all()
{
	while (!m_connected.empty())
	{
		signal_base* slot_base = *m_connected.begin();
		slot_base->disconnect(this);
	}
}
